package cn.edu.stu.syllabus.widgets;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;

/**
 * Created by daidaijie on 2017/3/29.
 */

public class ScrollEnabledLinearLayoutManager extends LinearLayoutManager {
    private boolean isScrollEnabled = true;

    public ScrollEnabledLinearLayoutManager(Context context) {
        super(context);
    }

    public ScrollEnabledLinearLayoutManager(Context context, boolean isScrollEnabled) {
        super(context);
        this.isScrollEnabled = isScrollEnabled;
    }

    public void setScrollEnabled(boolean flag) {
        this.isScrollEnabled = flag;
    }

    @Override
    public boolean canScrollVertically() {
        return isScrollEnabled && super.canScrollVertically();
    }
}